<?php


namespace App\Http\Controllers\Admin\Erm;


use App\Jobs\QiPao\ExcelJob;
use App\Response\Response;
use Illuminate\Http\Request;
use App\Exceptions\BasicException;
use App\Http\Controllers\BaseController;
use App\Enums\ErmEnum;

//首页
class IndexController extends BaseController
{

    /**
     * @api {get} /erm/index 预警系统首页
     * @apiVersion 0.1.0
     * @apiName 预警系统首页
     * @apiGroup 预警系统首页
     *
     *
     * @apiSuccessExample {json} Response-Example
     * {
     * "code": 200,
     * "data": {
     * "join_gray(今日加入灰名单用户数量)": {
     * "today_num(今日加入灰名单用户数量)": 2,
     * "difference_num(今天相比较昨天加入灰名单用户数量)": 0,
     * "difference_type(类型 1增加 2减少)": 1,
     * "week_num(本周加入灰名单用户数量)": 2
     * },
     * "remove_gray（今日脱离灰名单用户数量）": {
     * "today_num": 0,
     * "difference_num": 2,
     * "difference_type": 0,
     * "week_num": 0
     * },
     * "join_black（今日加入黑名单用户数量）": {
     * "today_num": 0,
     * "difference_num": 0,
     * "difference_type": 1,
     * "week_num": 0
     * },
     * "remove_black（今日脱离黑名单用户数量）": {
     * "today_num": 0,
     * "difference_num": 0,
     * "difference_type": 1,
     * "week_num": 0
     * },
     * "existing（现存灰/黑名单用户）": {
     * "gray_num(灰名单)": 3,
     * "gray_num_one(灰名单一项实名)": 1,
     * "gray_num_two(灰名单二项实名)": 1,
     * "gray_num_three(灰名单三项实名)": 0,
     * "black_num(黑名单)": 6,
     * "gray_percentage(灰名单百分比)": 0,
     * "gray_percentage_one(灰名单一项实名百分比)": 50,
     * "gray_percentage_two(灰名单二项实名百分比)": 50,
     * "gray_percentage_three(灰名单三项实名百分比)": 0,
     * "black_percentage(黑名单百分比)": 0
     * }
     * },
     * "message": ""
     * }
     */
    public function index(Request $request)
    {
        $data = app('repo_erm_index')->getIndexData();
        return Response::sendData($data);
    }


}